//
//  UIBarButtonItem+GYExtension.m
//  Visitor
//
//  Created by x on 2017/9/11.
//  Copyright © 2017年 HLB. All rights reserved.
//

#import "UIBarButtonItem+GYExtension.h"

@implementation UIBarButtonItem (GYExtension)

+ (instancetype)barButtonItemWithBack:(NSString *)image HightImage:(NSString *)hightImage Target:(id)target action:(SEL)action {
    UIButton *btu = [[UIButton alloc] init];
    [btu setBackgroundImage:[UIImage imageNamed:image] forState:UIControlStateNormal];
    [btu setBackgroundImage:[UIImage imageNamed:hightImage] forState:UIControlStateHighlighted];
    [btu addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
    [btu sizeToFit];
    
    return [[self alloc] initWithCustomView:btu];

}
@end
